import time
a = open('m1_sorted.txt')
sp = []
for i in a:
    sp.append(int(i))
def fail(sp):
    for i in range(len(sp) - 1):
        k = 0
        for h in range(len(sp) - 1 - i):
            if sp[h] > sp[h + 1]:
                sp[h], sp[h + 1] = sp[h + 1], sp[h]
        if k == 0:
            break
    return sp
start = time.time()
sp = fail(sp)
finish = time.time()
print('m1_sorted.txt', round((finish-start) * 1000), "milliseconds")
a1 = open('m2_reverse.txt')
sp1 = []
for i in a1:
    sp1.append(int(i))
start = time.time()
sp1 = fail(sp1)
finish = time.time()
print('m2_reverse.txt', round((finish-start) * 1000), "milliseconds")
a2 = open('m3_shuffle.txt')
sp2 = []
for i in a2:
    sp2.append(int(i))
start = time.time()
sp2 = fail(sp2)
finish = time.time()
print('m3_shuffle.txt', round((finish-start) * 1000), "milliseconds")